package com.hedl.classroom.base.exception;


/**
 * 自定义异常类型
 */
public class OnlinecClassroomException extends RuntimeException{
    private String errMessage;

    public OnlinecClassroomException() {
        super();
    }

    public OnlinecClassroomException(String message) {
        super(message);
        this.errMessage = message;
    }

    public String getErrMessage() {
        return errMessage;
    }

    public void setErrMessage(String errMessage) {
        this.errMessage = errMessage;
    }

    public static void cast(String message){
        throw new OnlinecClassroomException(message);
    }

    public static void cast(CommonError error){
        throw new OnlinecClassroomException(error.getErrMessage());
    }
}
